


const wrapper = document.querySelector('.wrapper');
const loginLink = document.querySelector('.login-link');
const registerLink = document.querySelector('.register-link');

const btn_submit = document.querySelector("#btn_submit");
const btn_register = document.querySelector("#btn_register");


registerLink.addEventListener('click', () => {
   
    wrapper.classList.add('active');
})

loginLink.addEventListener('click', () => {
   
    wrapper.classList.remove('active');
})



btn_submit.addEventListener("click", () => {
    
    let usercode = document.getElementById("login_usercode").value;
    let password = document.getElementById("login_password").value;
    if (!usercode) {
        G.alert("用户名不能为空");
        return;
    }
    if (!password) {
        G.alert("密码不能为空");
        return;
    }
    let user = { usercode: usercode, password: password };
    G.post("SystemManager/SystemUser/LoginSubmit", user, data => {
        console.log(data);
        if (data.Status == 0 && data.IsSuccess == true) {
            location.href = data.ReturnUrl || "/";

        }
    });

});


//注册用户
btn_register.addEventListener("click", () => {

    let username = document.getElementById("register_username");
    let usercode = document.getElementById("register_usercode");
    let password = document.getElementById("register_password");


});